package lxy;

public class Work{
    public static void main(String[] args) {
        zhHome z = new zhHome();
        zhHome h = new zhHome();
        z.start();
        h.start();
    }
}

class zhHome extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            if (Thread.currentThread().getName().equals("Thread-0")){
                System.out.println("我在听歌");
            }else {
                System.out.println("我在打游戏");
            }

        }
    }
}